/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package generator.connection;

import java.awt.Component;
import java.awt.Container;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author abosancic
 */
public class KillThread extends Thread{
    
    private Container con = null;
    private Component component;

    public KillThread(Container container, Component component) {
        this.con = container;
        this.component = component;
        this.start();
    }

    @Override
    public void run() {
        try {
            Thread.sleep(10);
            try {
                con.remove(component);
                con.repaint();
                con.validate();
            } catch (Exception e) {
                System.out.println("KillThread Error");
            }
            
            System.out.println("KillThread finish");
        } catch (InterruptedException ex) {
            Logger.getLogger(KillThread.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    
    
}
